﻿@model MVCToolkitWebExample.Models.InputModel
@using MVCToolkit.Controls

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Index</h2>
@using (Html.BeginForm())
{
    <ul>
        <li>
            @Html.LabelFor(model => model.FirstName)
            @Html.MVCToolKitInputFor(model => model.FirstName, MVCToolkit.Controls.InputType.Search, new { style = "firstname" }, new { id = "1" },
            new[] { 
                new KOBinding<MVCToolkitWebExample.Models.InputModel>() { HtmlAttribute = "value", Expression = model => model.FirstName },
                new KOBinding<MVCToolkitWebExample.Models.InputModel>() { HtmlAttribute = "new", Expression = model => model.LastName },
            })
            @Html.ValidationMessageFor(model => model.FirstName)
        </li>

        <li>
            @Html.LabelFor(model => model.LastName)
            @Html.MVCToolKitInputFor(model => model.LastName, htmlAttributes: new { @class = "lastnameclass" }, dataAttributes: new { id = 2 },
            koBindAttributes:
            new[] {
                new KOBinding<MVCToolkitWebExample.Models.InputModel>() { HtmlAttribute = "new", Expression = model => model.LastName },
            })
            @Html.ValidationMessageFor(model => model.LastName)
        </li>

        <li>
            @Html.LabelFor(model => model.Password)
            @Html.MVCToolKitPasswordFor(model => model.Password)
            @Html.ValidationMessageFor(model => model.Password)
        </li>

        <li>
            @Html.LabelFor(model => model.ConfirmPassword)
            @Html.MVCToolKitPasswordFor(model => model.ConfirmPassword)
            @Html.ValidationMessageFor(model => model.ConfirmPassword)
        </li>

        <li>
            @Html.LabelFor(model => model.IsMale)

            Male: 
            @Html.MVCToolKitRadioButtonFor(model => model.IsMale, true)

            Female:
            @Html.MVCToolKitRadioButtonFor(model => model.IsMale, false)
            @Html.ValidationMessageFor(model => model.IsMale)
        </li>

        <li>
            @Html.LabelFor(model => model.IsAbove18)
            @Html.MVCToolKitCheckBoxFor(model => model.IsAbove18)
            @Html.ValidationMessageFor(model => model.IsAbove18)
        </li>

        @Html.MVCToolKitHiddenFor(model => model.Id)

        <li>
            @Html.LabelFor(model => model.Email)
            @Html.MVCToolKitInputFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)
        </li>

        <li>
            Hobbies?
            @Html.MVCToolkitCheckboxListFor(model => model.Hobbies, Model.HobbyOptions)
        </li>

        <li>
            <input type="submit" value="submit" />
        </li>

    </ul>
    
    
}



